import axios from 'axios';

let base = '/api';

export const requestLogin = params => { return axios.post(`${base}/login`, params).then(res => res.data); };

export const editUser = params => { return axios.post(`${base}/edituser`,  params).then(res=>res.data); };

export const addUser = params => { return axios.post(`${base}/adduser`, params).then(res=>res.data); };

export const searchUser = params => { return axios.get(`${base}/searchuser`, {params:params}).then(res=>res.data); };

export const searchPlant = params => { return axios.get(`${base}/searchplant`, {params:params}).then(res=>res.data); };

export const searchWorkshop = params => { return axios.get(`${base}/searchworkshop`, {params:params}).then(res=>res.data); };

export const searchUserdaily = params => { return axios.get(`${base}/userdaily`, {params:params}).then(res=>res.data); };

export const downloadFile = params => { return axios.post(`${base}/downloadfile`, params).then(res => res.data); };

export const delPlant = params => { return axios.get(`${base}/delplant`, {params:params}).then(res=>res.data); };

export const RTA = params => { return axios.get(`${base}/rta`, {params:params}).then(res=>res.data); };

export const useenergy = params => { return axios.get(`${base}/useenergy`, {params:params}).then(res=>res.data); };

export const searchFile = () => { return axios.get(`${base}/searchfile`).then(res=>res.data); };

